1. Field of the Invention
The present invention relates to a microcomputer which can be used in communication systems and other data processing systems requiring the protection of secrecy.
2. Description of the Prior Art
A conventional microcomputer is shown in FIG. 5. The microcomputer 1 has an internal bus 1; an ALU (arithmetic-logic unit) 2; an instruction decoding unit 3; an instruction definition unit 4 which decodes encryption instructions sent through bus 1 to instruction decoding unit 3; a ROM 5 for storing programs; an input/output unit 6 for inputting or outputting data between the microcomputer and outside thereof; a RAM 7 for storing programs or data; and a peripheral function unit 8 that includes a timer. Data that have been encrypted by the repositioning of operation code bit strings in a pre-determined order are stored in the ROM 5 and RAM 7. The instruction definition unit 4 stores previously procedures for repositioning the bit strings of instructions for decoding, as a data table.
In operation, an encryption program that has been stored in the ROM 5 or RAM 7, or an encryption program that is provided from the outside of the microcomputer through the input/output unit 6 is sent to the instruction decoding unit 3 through bus 1 a single instruction at a time. The program is then decoded according to the data table stored in the instruction definition unit 4. Thereafter, the program is executed as an original program in the ALU 2.
Since the structure of conventional microcomputers is as described above, the data table used for decoding must be kept secret. It is therefore necessary to make it impossible to read out the contents of the instruction definition unit 4. For this reason, the normal operation of instruction definition unit 4 could be checked only indirectly by actually inputting a program and operating the microcomputer, but no accurate function testing could be conducted. Moreover, data that were input or output between the microcomputer and the outside through the ALU 2, RAM 7, or input/output unit 6 had to be encrypted during the input program stage, which required time and labor. Furthermore, since the encryption of the input program itself was fixed by the hardware of instruction definition unit 4, sophisticated encryption for higher security had involved longer and more difficult programs.